package com.cy.sweepgradientprogress;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener{
	private SweepGradientCircleProgressBar progress;
	private Button resetBtn;
	// 最大100
	private int max = 100;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		progress = findViewById(R.id.progress);
		resetBtn = findViewById(R.id.resetBtn);
		resetBtn.setOnClickListener(this);

		int[] arcColors = new int[]{
				Color.parseColor("#ffffe400"),
				Color.parseColor("#ffff4800")
		};
		progress.setArcColors(arcColors);
//		progress.setProgress(80);
		progress.startAnim(99);

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.resetBtn:
			//重置操作
			progress.startAnim(100);
			break;

		default:
			break;
		}
	}
}
